<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreatePurchaseWhiteListsTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up()
    {
        Schema::create('purchase_white_lists', function (Blueprint $table) {
            $table->id();
            $table->timestamps();
            $table->bigInteger('product_id')->index()->comment('商品ID');
            $table->string('user_mobile', 16)->index()->comment('用户手机号');
            $table->integer('early_buy_minutes')->default(0)->comment('可提前购买的时间');
            $table->integer('buy_limit')->comment('可购买数量');
            $table->string('status', 16)->comment('启用状态');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down()
    {
        Schema::dropIfExists('purchase_white_lists');
    }
}
